package com.hgl.servlet.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hgl.entity.Hgl;
import com.hgl.service.HglService;
import com.hgl.service.impl.HglServiceImpl;
@WebServlet("/admin/user-look.let")
public class UserLookServlet extends HttpServlet {
	private HglService hglservice = new HglServiceImpl();

	@Override
	protected void doGet(HttpServletRequest requset,
			HttpServletResponse response) throws ServletException, IOException {
		Integer hglId = null;
		try {
			hglId = Integer.valueOf(requset.getParameter("hglId"));
			Hgl hgl=hglservice.get(hglId);
			requset.setAttribute("hgl", hgl);
			requset.setAttribute("href", "admin/user-look.let");
		} catch (Exception ex) {
			throw new ServletException("参数错误", ex);
		}
		
		requset.getRequestDispatcher("/admin/user-look.jsp").forward(requset, response);
	}

}
